Are Concurrent Programs That Are Easier to Write Also Easier to Check?

نویسنده

  • Kedar S. Namjoshi
چکیده

This quote expresses the importance of choosing the right vocabulary to describe and reason about a concept. There is a long and rich history of language proposals for concurrency: semaphores, locks, wait-and-notify, monitors, conditional critical regions, rendezvous, message passing, and transactional memory. Which of these, if any, forms a good vocabulary? What criteria should one apply? My touchstone is the expression of common concurrency patterns. An important criterion for a vocabulary, in my view, is that it is possible to express common patterns in an “obviously correct” manner. The expectation is that simpler solutions are likely to have fewer or more easily detectable errors. An alternative view of this test is that common concurrency patterns should have simple and short proofs of correctness. To this end, consider three common concurrency patterns: a pipeline, a barrier, and a thread pool. The pipeline is pervasive in network processing. Typically, incoming packets are passed through a number of processing stages. This pattern is trivial to describe in terms of message exchanges (Figure 1). The particular style of message exchange is from Hoare’s work on Communicating Sequential Processes (CSP) [2]: in?msg represents a read from channel in to a variable msg, out!msg represents a write of the value of msg to channel out. Each channel has a single reader and writer. Communication is unbuffered and synchronous, in that both reads and writes block until the complementary operation is enabled, at which point the communication takes place. Next, consider a barrier for N processes. All processes have to reach the barrier before any can proceed. In the code in Figure 2, the barrier process counts arrivals; once all processes have arrived, it issues Proceed messages. The alt construct (also from CSP) is used to synchronize with one of toBarrier[1]?Arrived, ..., toBarrier[N]?Arrived. For the final, everyday example, consider a taxi rank at an airport (Figure 3). A taxi driver registers with a dispatcher, she is assigned a passenger, and she

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

On improving the ease of use of the software transactional memory abstraction. (Faciliter l'utilisation des mémoires transactionnelles logicielles)

Multicore architectures are changing the way we write programs. Writing concurrent programsis well known to be difficult task. Traditionally, the use of locks allowing code to executein mutual exclusion has been the most widely used abstraction to write concurrent programs.Unfortunately, using locks it is difficult to write correct concurrent programs that perform ef-ficiently. ...

متن کامل

Specified Blocks Eric

This paper argues that specified blocks have every advantage over the combination of assertions, preconditions, postconditions, invariants, and variants, both for verifying programs, and for program development. They are simpler, more general, easier to write, and they make proofs easier.

متن کامل

Specified Blocks

This paper argues that specified blocks have every advantage over the combination of assertions, preconditions, postconditions, invariants, and variants, both for verifying programs, and for program development. They are simpler, more general, easier to write, and they make proofs easier.

متن کامل

Explicit Relationships in Object Oriented Development

Traditional object oriented analysis methodolo-gies are based not only upon objects, but also upon relationships between objects. Object oriented programming languages do not provide support for relationships, and so analysis relationships must be expressed indirectly within a program's design, and then incorporated into implementations of other objects in a program's code. By using explicit re...

متن کامل

Fitting Second-order Models to Mixed Two-level and Four-level Factorial Designs: Is There an Easier Procedure?

Fitting response surface models is usually carried out using statistical packages to solve complicated equations in order to produce the estimates of the model coefficients. This paper proposes a new procedure for fitting response surface models to mixed two-level and four-level factorial designs. New and easier formulae are suggested to calculate the linear, quadratic and the interaction coeff...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2008